package cn.brilliantfuture.commentry.entity;

// Generated 2011-11-3 13:34:34 by Hibernate Tools 3.3.0.GA

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * StorageGridSensor generated by hbm2java
 */
@Entity
@Table(name = "storage_grid_sensor", catalog = "cabinet")
public class StorageGridSensor implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer storageGridSensorId;
	private StorageGrid storageGrid;
	private Float temp;
	private Float humi;
	private int workState = 0;
	private Date insertTime;

	public StorageGridSensor() {
	}

	public StorageGridSensor(StorageGrid storageGrid, Float temp, Float humi,
			Date insertTime) {
		this.storageGrid = storageGrid;
		this.temp = temp;
		this.humi = humi;
		this.insertTime = insertTime;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "storage_grid_sensor_id", unique = true, nullable = false)
	public Integer getStorageGridSensorId() {
		return this.storageGridSensorId;
	}

	public void setStorageGridSensorId(Integer storageGridSensorId) {
		this.storageGridSensorId = storageGridSensorId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "storage_grid_id")
	public StorageGrid getStorageGrid() {
		return this.storageGrid;
	}

	public void setStorageGrid(StorageGrid storageGrid) {
		this.storageGrid = storageGrid;
	}

	@Column(name = "temp", precision = 12, scale = 0)
	public Float getTemp() {
		return this.temp;
	}

	public void setTemp(Float temp) {
		this.temp = temp;
	}

	@Column(name = "humi", precision = 12, scale = 0)
	public Float getHumi() {
		return this.humi;
	}

	public void setHumi(Float humi) {
		this.humi = humi;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "insert_time", length = 19)
	public Date getInsertTime() {
		return this.insertTime;
	}

	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}
	
	@Column(name = "work_state", nullable = false)
	public int getWorkState() {
		return workState;
	}

	public void setWorkState(int workState) {
		this.workState = workState;
	}

}
